﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using SNSpirit.Service.Authentication;
using SNSpirit.Service.Authentication.Integrated;
using SNSpirit.Service.Certificate;

namespace SNSpirit.Plugins.CC98.Authentication
{
    public class NamePasswordAuthenticationConnector : INamePasswordAuthenticationConnector
    {
        public virtual AuthResult GetAuthenticationState()
        {
            return new AuthResult(new AuthToken(this, this._cookies), null);
        }

        public virtual AuthenticationToken Validate(INamePasswordCertificate certificate, object additionalData)
        {
            throw new NotImplementedException();
        }

        public virtual LogoutResult Logout(AuthenticationToken token)
        {
            throw new NotImplementedException();
        }

        protected virtual void OnAuthenticationStateChanged()
        {
            if (this.AuthenticationStateChanged != null)
                this.AuthenticationStateChanged(this, new EventArgs());
        }

        public event EventHandler AuthenticationStateChanged;

        private CookieCollection _cookies;
    }
}